##assumes equal classes distribution
function [slice1 slice2] = sliceData(data, ratio)
    
    uniqCl = unique(data(:,1));
    skolko = floor(sum(data(:,1)==uniqCl(1,1))*ratio);

    slice1=[];
    slice2=[];

    for(i=1:size(uniqCl,1))
        subdata = data(data(:,1)==uniqCl(i),:);
            order = randperm(size(subdata,1));
        slice1=[slice1; subdata(order(1:skolko),:)];
        slice2=[slice2; subdata(order(skolko+1:end),:)];
    endfor;    

#    divRow = floor(size(data,1)*ratio);
#    slice1 = data(order(1:divRow),:);
#    slice2 = data(order(divRow+1:end),:);
endfunction;
